﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IankerProj.Models;

namespace IankerProj.Controllers
{
    public class ThietBiController : Controller
    {
        //
        // GET: /ThietBi/
        AnkerDBEntities db = new AnkerDBEntities();
        public ActionResult Index(int id)
        {
            var p = db.Sanphams.Where(c => c.idcha == id).ToList();
            return View(p);
        }
        public ActionResult Menucon(int id)
        {
            var p = db.Sanphams.Where(c => c.idcha == id).ToList();
            return View(p);
        }
        public ActionResult Sanphamchitiet(int id)
        {
            var e = db.Sanphams.Where(d => d.id == id).FirstOrDefault();
            ViewBag.ten = e.ten;
            var p = db.Sanpham_thietbi.Where(c => c.idsanpham == id).ToList();
            return View(p);
        }
        public ActionResult Chitiet(int id)
        {
            var p = db.Thietbis.Where(c => c.id == id).ToList();
            return View(p);
        }
    }
}
